package com.itheima.youdianda.showBuDing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.youdianda.domain.YddArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @ClassName MyYddArticleServiceMapper
 * @Description
 * @Author Young
 * @Date 2023/2/15 0:39
 * @Version 1.0
 */
@Mapper
public interface MyYddArticleMapper  extends BaseMapper<YddArticle> {
    @Select("select * from ydd_article where id = (select max(id) from ydd_article where id < #{id} and status =2)")
    public YddArticle prev(Integer id);

    @Select("select * from ydd_article where id = (select min(id) from ydd_article where id > #{id} and status =2)")
    public YddArticle next(Integer id);
}
